package cn.edu.huanu.utils;

import com.fasterxml.jackson.annotation.JsonInclude;

/**
 * @author hb
 * @date 2025-11-06 10:49:18
 */
@JsonInclude(JsonInclude.Include.NON_NULL)
public class R {
    //业务信息
    private String message;
    //业务状态
    private boolean success;
    //业务编码
    private Integer code;
    //业务结果
    private Object data;

    public  R success(){

        this.setSuccess(true);
        this.setCode(200200);
        return this;
    }

    public    R error(){

        this.setSuccess(false);
        return this;
    }

    public String getMessage() {
        return message;
    }

    public void setMessage(String message) {
        this.message = message;
    }

    public boolean isSuccess() {
        return success;
    }

    public void setSuccess(boolean success) {
        this.success = success;
    }

    public Integer getCode() {
        return code;
    }

    public void setCode(Integer code) {
        this.code = code;
    }

    public Object getData() {
        return data;
    }

    public void setData(Object data) {
        this.data = data;
    }
}
